<script lang="ts" setup>
import { ref,onMounted } from 'vue'
import {getCateGoryBrandProListAPI} from '@/API/category'
import { useRoute,useRouter } from 'vue-router';
const route = useRoute()
const router = useRouter()
const goodsList = ref<any>([])


const getGoodsList=async() =>{
const res = await getCateGoryBrandProListAPI(1,10,route.query.category,route.query.brand)
console.log(res);
goodsList.value = res.data

}

onMounted(() => {
  getGoodsList()
})
</script>

<template>
 <van-nav-bar fixed title="商品列表" left-arrow @click-left="$router.go(-1)" />

 <div class="fixeds">
      <van-card v-for="item in goodsList" :num="item.discount" :tag="item.brand" :price="item.originprice.toFixed(2)" :desc="item.desc" :title="item.category" :thumb="item.img1" origin-price="10.00" @click="router.push(`/detail/${item.proid}`)" />
    </div>
</template>

<style scoped lang="less">
.fixeds{
  margin-top: 46px;
}
</style>